package org.msn.mapper.database;

import org.msn.mapper.database.impl.MemoryRepositoryImpl;
import org.msn.mapper.database.impl.MySQLRepositoryImpl;

import java.util.Map;

import static org.msn.model.constant.DatabaseTypeConstant.*;

public class DatabaseStrategy {
    public Repository createDatabaseLink(String type, Map<String, Object> info) {
        switch (type) {
            case MEMORY:
                return new MemoryRepositoryImpl(type, info);
            case MYSQL:
                return new MySQLRepositoryImpl(type, info);
            default:
                return null;
        }
    }
}
